package com.douqu.game.auth.database.model;

import java.util.Date;

/**
 * @author wangzhenfei
 *         2018-01-06 16:32
 *         公告
 */
public class NoticeMessageModel {
    private Integer id;
    private Integer show;
    private String content;
    private Integer platform;
    private Date startTime;
    private Date endTime;

    public Integer getPlatform() {
        return platform;
    }

    public void setPlatform(Integer platform) {
        this.platform = platform;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getShow() {
        return show == null ? 0 : show.intValue();
    }

    public void setShow(Integer show) {
        this.show = show;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public int isAutoShowNotice(){
        if(startTime == null || endTime == null)
            return 0;

        if(System.currentTimeMillis() > startTime.getTime() &&
                System.currentTimeMillis() < endTime.getTime()){
            return 1;
        }
        return 0;
    }
}
